udevd_all_src_files="
$udevd_common_src_files
$udevd_src_files
$udevadm_src_files
"

################################################################################

sep_start;echo 'udevd:preprocess src files'
for udevd_all_src_file in $udevd_all_src_files
do
    udevd_all_pp_c_file=${udevd_all_src_file%.c}
    udevd_all_pp_c_file=${udevd_all_pp_c_file}.pp.c
    echo "BIN_CPP $udevd_all_src_file->$udevd_all_pp_c_file"
    mkdir -p $(dirname $udevd_all_pp_c_file)
    $bin_cpp $CPPFLAGS -I. -I$src_path -o $udevd_all_pp_c_file \
                                               $src_path/src/$udevd_all_src_file
    udevd_all_pp_c_files="$udevd_all_pp_c_file $udevd_all_pp_c_files"
done
sep_end

################################################################################

sep_start;echo 'udevd:compile preprocessed src files'
for udevd_all_pp_c_file in $udevd_all_pp_c_files
do
    udevd_all_obj_file=${udevd_all_pp_c_file%.pp.c}
    udevd_all_obj_file=${udevd_all_obj_file}.o
    echo "BIN_CC $udevd_all_pp_c_file-->$udevd_all_obj_file"
    $bin_cc $CFLAGS -o $udevd_all_obj_file $udevd_all_pp_c_file
    udevd_all_obj_files="$udevd_all_obj_file $udevd_all_obj_files"
done
sep_end

################################################################################

for udevd_common_src_file in $udevd_common_src_files
do
    udevd_common_obj_file=${udevd_common_src_file%.c}
    udevd_common_obj_file=${udevd_common_obj_file}.o
    udevd_common_obj_files="$udevd_common_obj_file $udevd_common_obj_files"
done

for udevd_src_file in $udevd_src_files
do
    udevd_only_obj_file=${udevd_src_file%.c}
    udevd_only_obj_file=${udevd_only_obj_file}.o
    udevd_only_obj_files="$udevd_only_obj_file $udevd_only_obj_files"
done

for udevadm_src_file in $udevadm_src_files
do
    udevadm_obj_file=${udevadm_src_file%.c}
    udevadm_obj_file=${udevadm_obj_file}.o
    udevadm_obj_files="$udevadm_obj_file $udevadm_obj_files"
done

################################################################################

mkdir -p -- "$fake_root/$e_eprefix/sbin"

################################################################################

sep_start;echo 'udevd:link the object files to produce the binary'
echo "BIN_CCLD udevd"
$bin_ccld -o "$fake_root/$e_eprefix/sbin/udevd" "$fake_root/$e_libdir/libudev.so.0.0.0" $udevd_common_obj_files $udevd_only_obj_files $(pkg-config --libs blkid) $(pkg-config --libs libkmod)
sep_end

################################################################################

sep_start;echo 'udevadm:link the object files to produce the binary'
echo "BIN_CCLD udevadm"

$bin_ccld -o "$fake_root/$e_eprefix/sbin/udevadm" "$fake_root/$e_libdir/libudev.so.0.0.0" $udevd_common_obj_files $udevadm_obj_files $(pkg-config --libs blkid) $(pkg-config --libs libkmod)
sep_end
